package com.app.common;

/**
 * Copyright (C) @2020 fgwang.660@gmail.com
 *
 * @author witt
 * @version 1.0
 * @className AppException
 * @date 2020-06-14 12:23
 * @description App系统异常
 */
public class AppException extends RuntimeException {
	private static final long serialVersionUID = - 1290794458822718233L;

	// 异常消息内容
	private final String message;

	/**
	 * 将字符串message消息包装为异常对象，禁止程序向下执行，发生堆栈
	 *
	 * @param message
	 */
	public AppException(String message) {
		super(message);
		this.message = message;
	}

	/**
	 * 包装Throwable异常的构造器
	 *
	 * @param cause
	 */
	public AppException(Throwable cause) {
		super(cause);
		this.message = cause.getMessage();
	}

	/**
	 * 获取异常消息
	 *
	 * @return
	 */
	@Override
	public String getMessage() {
		return message;
	}
}
